﻿using com.guojin.core.io;
using com.guojin.core.io.message;
using com.guojin.mj.net.message.game;
using System.Collections.Generic;

namespace com.guojin.mj.net.message.game
{
    public class GameEndRet : Message
    {
        public static int TYPE = 12;
        public static int ID = 18;

        public string gameEndTime { get; set; } //精确到秒
        public string roomId { get; set; } //房间号（6位）
        public int currentChapter { get; set; } //当前局数
        public int maxChapter { get; set; } //最大局数
        public List<UserGameEndInfoRet> userGameEnd;  

        public int WinnerLocationdIndex { get; set; }

        public void decode(Input _in)
        {
            gameEndTime = _in.readString();
            roomId = _in.readString();
            currentChapter = _in.readInt();
            maxChapter = _in.readInt();
            userGameEnd = new List<UserGameEndInfoRet>();
            userGameEnd = _in.readList<UserGameEndInfoRet>(_in);
        }

        public void encode(Output _out)
        {
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return "GameEndRet[gameEndTime=" +gameEndTime + "roomIDTex=" +roomId+"currentChapter="+currentChapter+
                "maxChapter="+maxChapter+ " ]";
        }
    }
}